package com.sean.designpatterns.create.builder;

import java.util.ArrayList;
import java.util.List;

public class Meal {

    private List<Food> meals = new ArrayList<>();

    public void addFood(Food food) {
        this.meals.add(food);
    }

    public float getCost() {
        float cost = 0.0f;
        for (Food food : meals) {
            cost += food.cost();
        }

        return  cost;
    }
    public void showFoods(){
        for(Food food:meals){
            System.out.println(food.name()+food.pack().pick() +food.cost());
        }
    }
}
